<!--
 * @Author: your name
 * @Date: 2021-08-27 14:56:38
 * @LastEditTime: 2021-08-27 16:27:17
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \common-vue\kVue\KVue.html
-->
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
  <div id="app">
    <div>{{count}}</div>
    <div>{{count}}</div>
    <div k-text="name"></div>
    <div k-html="city"></div>
    <br />
    <button k-click="addCount">按钮1</button>
    <button k-click="changName">按钮2</button>
  </div>

  <script type="text/javascript" src="./KVue.js"></script>
  <script>
    const app = new KVue({
      el: '#app',
      data: {
        count: 1,
        name: 'wujiedong',
        city: '<span style="color: red">江苏无锡</span>'
      },
      methods: {
        addCount() {
          this.count = this.count + 1
        },
        changName() {
          this.name = this.name === 'wujiedong' ? 'wuyuhao' : 'wujiedong'
        }
      }
    })

    // setInterval(() => {
    //   app.count++
    // }, 15000)
  </script>
</body>
</html>